/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.kj.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * kj_member_badgeEntity
 * @author hzy
 * @version 2021-07-17
 */
@Table(name="kj_member_badge", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="member_id", attrName="memberId", label="用户id"),
		@Column(name="badge_id", attrName="kjBadge.id", label="徽章ID"),
		@Column(name="member_name", attrName="memberName", label="用户名", queryType=QueryType.LIKE),
		@Column(name="gather_time", attrName="gatherTime", label="获得时间"),
		@Column(name="is_view", attrName="isView", label="是否阅读"),
		@Column(includeEntity=DataEntity.class),
	}, joinTable={
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= KjBadge.class, alias="b",
				on="b.id = a.badge_id",
				columns={@Column(includeEntity=KjBadge.class)})
}, orderBy="a.update_date DESC"
)
public class KjMemberBadge extends DataEntity<KjMemberBadge> {

	private static final long serialVersionUID = 1L;
	public static final String ISVIEW = "1";
	private String memberId;		// 用户id
	private String badgeId;		// 徽章ID
	private String memberName;		// 用户名
	private String isView;		// 用户名
	private Date gatherTime;		// 获得时间
	private KjBadge kjBadge;

	public KjMemberBadge() {
		this(null);
	}

	public KjMemberBadge(String id){
		super(id);
	}

	@Length(min=0, max=64, message="用户id长度不能超过 64 个字符")
	public String getMemberId() {
		return memberId;
	}

	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}

	public String getBadgeId() {
		return badgeId;
	}

	public void setBadgeId(String badgeId) {
		this.badgeId = badgeId;
	}

	@Length(min=0, max=255, message="用户名长度不能超过 255 个字符")
	public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getGatherTime() {
		return gatherTime;
	}

	public void setGatherTime(Date gatherTime) {
		this.gatherTime = gatherTime;
	}

	public KjBadge getKjBadge() {
		return kjBadge;
	}

	public void setKjBadge(KjBadge kjBadge) {
		this.kjBadge = kjBadge;
	}

	public String getIsView() {
		return isView;
	}

	public void setIsView(String isView) {
		this.isView = isView;
	}
}
